Skip to content

Conversation

@dan-gulliver
Copy link

I wanted to set a custom prompt https://developers.google.com/identity/openid-connect/openid-connect#prompt in the request so that I can always show the Google account list instead of automatically use the logged-in user.

But I couldn't find a way to do it inside this library.
What I saw is that AppAuth supports it by setting it in extraParams: openid/AppAuth-iOS#6 (comment)

The only problem is that I couldn't find a way to set these extraParams from outside of Google Sign in library.
So I added an extra params argument to the signin function and internally set them inside AppAuth call.

@google-cla
Copy link

google-cla bot commented Feb 13, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

additionalParams:(nullable NSDictionary *)extraParams
completion:(nullable GIDSignInCompletion)completion {
GIDSignInInternalOptions *options =
GIDSignInInternalOptions *options =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please remove the extra space in the beginning of this line?

- (void)signInWithPresentingViewController:(UIViewController *)presentingViewController
hint:(nullable NSString *)hint
additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
additionalParams:(nullable NSDictionary *)extraParams

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we keep the original method and create another method with the additionalParams parameter, to prevent breaking existing client integrations with this API? We can have the original method call this method with nil as additionalParams.

/// @param additionalScopes An optional array of scopes to request in addition to the basic profile scopes.
/// @param completion The optional block that is called on completion. This block will
/// be called asynchronously on the main queue.
- (void)signInWithPresentingViewController:(UIViewController *)presentingViewController

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add documentation comment on the new parameter.

completion:completion];
[self signInWithOptions:options];

if (extraParams != nil) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add tests for this method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants